include("shared.lua");
AddCSLuaFile("cl_init.lua");
AddCSLuaFile("shared.lua");
-- Setting up all the different properties of our melon.
ENT.Delay = 1;
ENT.Healthlol = 50;
ENT.FiringRange = 700;
ENT.NoMoveRange = 50;
ENT.MinRange = 0;
ENT.DeathRadius = 30;
ENT.DeathMagnitude = 3;
ENT.MovingForce = 20;
ENT.MelonModel = "models/props_junk/watermelon01.mdl";

-- Now we tell the base class to set up the melon. Pay attention - the variables must be defined BEFORE calling Setup().
function ENT:Initialize()
	self:Setup();
	if (self.Team == 1) then
	self.Entity:SetColor (125, 0, 0, 255)
	end
	if (self.Team == 2) then
	self.Entity:SetColor (0, 0, 125, 255)
	end
	if (self.Team == 3) then
	self.Entity:SetColor (0, 125, 0, 255)
	end
	if (self.Team == 4) then
	self.Entity:SetColor (125, 125, 0, 255)
	end
	if (self.Team == 5) then
	self.Entity:SetColor (125, 0, 125, 255)
	end
	if (self.Team == 6) then
	self.Entity:SetColor (0, 125, 125, 255)
	end
if !self.Grav then 
self.MovingForce = (self.MovingForce * server_settings.Int( "WM_Flyingspeed", 0.75))
end
Sound ("Weapon_P90.Single");
end
--What to do when we've found a target, and we've got the goahead to start attacking
function ENT:Attack()
		local angle = self.Target:GetPos() - self.Entity:GetPos();
		local bullet = {};
		bullet.Num = 1;
		bullet.Src = self.Entity:GetPos();
		bullet.Dir = angle:Normalize();
		bullet.Spread = Vector (0.06, 0.06, 0.06);
		bullet.Tracer = 1;
		bullet.Force = 0;
		bullet.Damage = 5;
		bullet.TracerName = "AR2Tracer";
		self.Entity:FireBullets (bullet);
		local fx = EffectData();
		fx:SetOrigin(self.Entity:GetPos());
		fx:SetAngle(angle:Angle());
		fx:SetScale(1.5);
		util.Effect("MuzzleEffect", fx);
		self.Entity:EmitSound("Weapon_P90.Single", 100, 100);
end

--Any other code you want to tag on to the end of the think function.
function ENT:OtherThoughts()
end
